package com.glqiang.controller;

import com.glqiang.domain.vo.MenuVo;
import com.glqiang.response.ResponseResult;
import com.glqiang.service.MenuService;
import com.glqiang.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author glqiang
 * @date 2022/11/22 22:44
 */
@RestController
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping("/listMenu")
    public ResponseResult<List<MenuVo>> listMenu() {
        Long userId = SecurityUtils.getUserId();
        return menuService.listMenu(userId);
    }
}
